<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="s" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>


<head>
	
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>新增或修改模块</title>
</head>
<body>
	<form:form id="moduleForm" method="post" action="secure/module/save.html" modelAttribute="module" cssClass="form-horizontal form-offset-top">
		<form:hidden id="moduleId" path="moduleId"/>
		<form:hidden id="parentModuleId" path="parentSysModule.moduleId"/>
		<form:hidden id="treeCode" path="treeCode"/>
		<form:hidden id="parentTreeCode" path="parentSysModule.treeCode"/>
		<form:hidden id="rightId" path="rightId"/>
		<div class="control-group ">
			<form:label cssClass="control-label" for="parentModuleName" path="parentSysModule.moduleName" >上级模块</form:label>
			<div class="controls">
				<c:choose>
					<c:when test="${not empty module.rightCode}">
						<form:input id="parentModuleName" readonly="true" path="parentSysModule.moduleName" />
					</c:when>
					<c:otherwise>
						<form:input id="parentModuleName" path="parentSysModule.moduleName" />
					</c:otherwise>
				</c:choose>
				<span class="help-inline"></span>
			</div>
		</div>
	 		
	 	<div class="control-group ">
			<form:label cssClass="control-label" for="moduleName" path="moduleName" >模块名称</form:label>
			<div class="controls">
				<form:input id="moduleName" path="moduleName" check-type="required" required-message="模块名称不能为空!"/>
			</div>
		</div>
		
		<div class="control-group ">
			<form:label cssClass="control-label" for="moduleUrl" path="moduleUrl" >模块URL</form:label>
			<div class="controls">
				<form:input id="moduleUrl" path="moduleUrl" />
				<span class="help-inline"></span>
			</div>
		</div>
		
		<div class="control-group ">
			<form:label cssClass="control-label" for="rightCode" path="rightCode">权限编码</form:label>
			<div class="controls">
				<form:input id="rightCode" path="rightCode" placeholder="格式:IDR_XXX,建议用大写字母!"
					check-type="required ajaxCheck" required-message="权限编码不能为空!" ajaxCheck-message="权限编码已存在!"/>
			</div>
		</div>
		
		<div class="control-group ">
			<form:label cssClass="control-label" for="remark" path="remark" >备注</form:label>
			<div class="controls">
				<form:textarea id="remark" path="remark" />
				<span class="help-inline"></span>
			</div>
		</div>
		
		<div class="control-group ">
			<div class="controls">
				<input id="saveBtnForModule" type="button" class="btn" onclick="if(saveModule()==false) return false;" value="保存">
				<input id="resetBtnForModule" type="reset" class="btn" value="重置">
			</div>
		</div>
		<div class="alert" style="visibility: hidden;width: 55px;margin-left: 30%;"/>
	</form:form>
</body>
</html>